﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;


using Jungle.Code.Utils;
using Jungle.Prodamo.AdvertManager;
using Jungle.Prodamo.PriceManager;
using Jungle.Prodamo.MostNeedFunctions;

namespace Jungle.Prodamo.User.WebControls
{
    public class FreshPrice : WebControl
    {

        protected override void RenderContents(HtmlTextWriter writer)
        {
            Price price = new Price();
            price.GetFresh();

            List<Price> PriceList = price.PriceList;
            foreach (Price p in PriceList)
            { 
                Model m = new Model();
                m.ModelId = p.ModelId;
                m.GetById();
                writer.Write("<a href=\"" + UrlHelper.GetSiteUrl() + "/ru/price.aspx?pId=" + p.PriceId.ToString() + "\">" + m.Title + "</a>&nbsp:&nbsp:&nbsp:");
            }

            base.RenderContents(writer);
        }
    }
}
